package command

import (
	"duplicateMyDB/internal/config"
	"fmt"
	"log"

	"github.com/spf13/cobra"
)

var (
	VersionCmd = &cobra.Command{
		Use:   "version",
		Short: "Show version",
		Run: func(cmd *cobra.Command, args []string) {
			version()
		},
	}
	Version = "1.0.0"

	conf *config.Config
)

func version() {
	fmt.Println("##########################################################")
	fmt.Println("duplicateMyDB v" + Version)
	fmt.Println("##########################################################")
}

func init() {
	var err error
	conf, err = config.LoadConfig()
	if err != nil {
		log.Fatalf("Failed to load config: %v", err)
	}
}
